package hos.base.activity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import hos.base.view.IFragmentActivityX;
import hos.thread.IThread;

/**
 * <p>Title: BaseActivity </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2021/8/21 19:07
 */
public abstract class BaseActivity extends AppCompatActivity implements IThread,  IFragmentActivityX<BaseActivity> {

    public BaseActivity() {
    }

    //    @ContentView
    public BaseActivity(int contentLayoutId) {
        super(contentLayoutId);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ViewGroup contentParent = getWindow().getDecorView().findViewById(android.R.id.content);
        onCreateView(getLayoutInflater(), contentParent, savedInstanceState);
        onViewShowed(contentParent);
    }

    public abstract void onCreateView(@NonNull LayoutInflater inflater,
                                      @Nullable ViewGroup container,
                                      @Nullable Bundle savedInstanceState);

    @Override
    public void onViewShowed(@NonNull View view) {

    }
}
